//
// Created by Tony on 2024/6/19.
//

#ifndef RUNTIME_LT_H
#define RUNTIME_LT_H

#include "Instruction.h"
#include <cstdint>

namespace Runtime {

class LT final : public CompareInstruction {

public:
    LT() : CompareInstruction(__func__, OpCode::LT) {}

    void execute(RtData::Frame& frame) override {
        auto right = frame.popValue();
        auto left = frame.popValue();
        auto ret = cmp(left, right);
        frame.pushValue(RtTaggedValue(static_cast<int64_t>(ret.value.int64 == -1)));
    }
};

} // namespace Runtime

#endif // RUNTIME_LT_H